import fetch from 'utils/fetch';

export function loginByEmail(username, password) {
  const data = {
    username,
    password
  };
  return fetch({
    url: '/admin/login',
    method: 'post',
    data
  });
}

export function logout() {
  return fetch({
    url: '/admin/getUser',
    method: 'post'
  });
}

export function getInfo() {
  return fetch({
    url: '/admin/getUserInfo',
    method: 'post'
  });
}

